package eclipse.weibo.service;

import java.util.List;

import weibo4j.DirectMessage;
import eclipse.weibo.util.WeiboUtil;

public class ReadMessageThread extends Thread {
    private MyObservable ob;
    private int i;

    public ReadMessageThread(MyObservable ob, int i) {
        this.ob = ob;
        this.i = i;
    }

    public void run() {
        List<DirectMessage> list = null;

        if (this.i == 0) {
            list = WeiboUtil.getMyMessage(0);
        } else if (this.i == 1) {
            list = WeiboUtil.getMyMessage(1);
        } else if (this.i == -1) {
            list = WeiboUtil.getMyMessage(-1);
        }

        this.ob.notifyObservers(list);
    }
}
